package com.PinZhuo.www;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by tukela on 2015/10/12.
 */
public class MyFragmentAdapter extends FragmentPagerAdapter {
    private final List<Fragment> list;

    public MyFragmentAdapter(FragmentManager fm,List<Fragment> list) {
        super(fm);
        this.list=list;
    }

    @Override
    public Fragment getItem(int i) {
        if (list==null||list.size()==0)
        {
            return null;
        }
        return list.get(i);

    }

    @Override
    public int getCount() {
        if (list==null||list.size()==0)
        {
            return 0;
        }
        return list.size();
    }
}
